<?php

namespace pmvc\mvc\view;

use pmvc\mvc\ViewHandler;
use pmvc\mvc\Dispatcher;
use pmvc\mvc\Model;

class JSONViewHandler 
    implements ViewHandler {
    	
    function renderView(Model $model, $viewName, Dispatcher $dispatcher) {
    	header("Content-Type: application/json");
    	fwrite($dispatcher->getOutputStream(), json_encode($model));
    }
    
}

?>